Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

append applied_flows container before filling instead of after #641

Merged
merged 1 commit into from
Oct 24, 2022

Conversation

jmitrevs
Copy link
Contributor

Description

This change simply appends applied_flows to ModelGraph._applied_flows in the beginning, before it is filled, so that ModelGraph._applied_flows always has an accurate description of what has been applied. This is important in the FIFO depth optimization, because the FifoDepthOptimization runs the writer flow outside of the main flow, before the flow is finished and before ModelGraph._applied_flows is updated, so currently it sees ModelGraph._applied_flows == [], and since the writer depends on 'vivado:ip', all the optimizers are run again, which sometimes messes things up. For example, running on a ResNet sample, rerunning the optimizers changes a type from being PackedType to just being FixedPrecisionType, causing it to fail. This way, ModelGraph._applied_flows is always current so the out of main flow writer does not run 'vivado:ip' again.

I also updated a few empty lists to empty sets so that applied_flows is always a dictionary of sets, not a dictionary of sets or empty lists.

Type of change

  • Bug fix (non-breaking change that fixes an issue)

Tests

The main test is to see that this doesn't break the current pytests. The FIFO optimization is too long to run as a standard test.

Checklist

  • I have read the guidelines for contributing.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have made corresponding changes to the documentation.
  • My changes generate no new warnings.

…e consistent using empty sets intead of lists)
@jmitrevs jmitrevs requested a review from vloncar August 22, 2022 23:14
@jmitrevs
Copy link
Contributor Author

jmitrevs commented Aug 23, 2022

There is a change in the fifo depth optimization discussed in in in #642, basically getting rid of the explict, out of flow write called from the optimizer, that would make this change unnecessary in the case I mentioned, though this change would still be beneficial, I believe.

@jmitrevs
Copy link
Contributor Author

I think this change should go in since it fixes the current fifo depth optimization, and even if we change how we do the optimization, this will have no ill effect.

@jmitrevs
Copy link
Contributor Author

Any more thoughts on this? I have to tell people to use it if they are doing fifo depth optimization, which is a bit annoying.

Copy link
Contributor

@vloncar vloncar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Let's hope this doesn't blow up into our faces.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants